package org.neuedu.practice02;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class School {
    // 学生名单
    public List<Student> studentList = new ArrayList<>();
    // 签到名单
    public Map<String, List<SignInfo>> map = new HashMap<>();

    /**
     * 根据 id 查找学生对象
     * @param id 学生id
     * @return
     */
    public Student getStudentById(int id) {
        for (Student student : studentList) {
            if (student.getId() == id) {
                return student;
            }
        }
        return null;
    }
}
